Optimal. Leaf size=74 \[ -\frac{3 a^2 \tan (e+f x)}{c f}-\frac{3 a^2 \tanh ^{-1}(\sin (e+f x))}{c f}-\frac{2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{f (c-c \sec (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0993604, antiderivative size = 74, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.156, Rules used = {3957, 3787, 3770, 3767, 8} \[ -\frac{3 a^2 \tan (e+f x)}{c f}-\frac{3 a^2 \tanh ^{-1}(\sin (e+f x))}{c f}-\frac{2 \tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{f (c-c \sec (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3957
Rule 3787
Rule 3770
Rule 3767
Rule 8
Rubi steps
\begin{align*} \int \frac{\sec (e+f x) (a+a \sec (e+f x))^2}{c-c \sec (e+f x)} \, dx &=-\frac{2 \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{f (c-c \sec (e+f x))}-\frac{(3 a) \int \sec (e+f x) (a+a \sec (e+f x)) \, dx}{c}\\ &=-\frac{2 \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{f (c-c \sec (e+f x))}-\frac{\left (3 a^2\right ) \int \sec (e+f x) \, dx}{c}-\frac{\left (3 a^2\right ) \int \sec ^2(e+f x) \, dx}{c}\\ &=-\frac{3 a^2 \tanh ^{-1}(\sin (e+f x))}{c f}-\frac{2 \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{f (c-c \sec (e+f x))}+\frac{\left (3 a^2\right ) \operatorname{Subst}(\int 1 \, dx,x,-\tan (e+f x))}{c f}\\ &=-\frac{3 a^2 \tanh ^{-1}(\sin (e+f x))}{c f}-\frac{3 a^2 \tan (e+f x)}{c f}-\frac{2 \left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{f (c-c \sec (e+f x))}\\ \end{align*}
Mathematica [B] time = 1.71673, size = 220, normalized size = 2.97 \[ \frac{2 a^2 \sin \left (\frac{1}{2} (e+f x)\right ) \cos \left (\frac{1}{2} (e+f x)\right ) \sec (e+f x) \left (4 \csc \left (\frac{e}{2}\right ) \sin \left (\frac{f x}{2}\right ) \sec \left (\frac{1}{2} (e+f x)\right )+\tan \left (\frac{1}{2} (e+f x)\right ) \left (\frac{\sin (f x)}{\left (\cos \left (\frac{e}{2}\right )-\sin \left (\frac{e}{2}\right )\right ) \left (\sin \left (\frac{e}{2}\right )+\cos \left (\frac{e}{2}\right )\right ) \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right ) \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )}-3 \log \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )+3 \log \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )\right )\right )}{f (c-c \sec (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.063, size = 116, normalized size = 1.6 \begin{align*}{\frac{{a}^{2}}{fc} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-1}}-3\,{\frac{{a}^{2}\ln \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }{fc}}+{\frac{{a}^{2}}{fc} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) -1 \right ) ^{-1}}+3\,{\frac{{a}^{2}\ln \left ( \tan \left ( 1/2\,fx+e/2 \right ) -1 \right ) }{fc}}+4\,{\frac{{a}^{2}}{fc\tan \left ( 1/2\,fx+e/2 \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.03162, size = 304, normalized size = 4.11 \begin{align*} -\frac{a^{2}{\left (\frac{\frac{3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 1}{\frac{c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac{c \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac{\log \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{c} - \frac{\log \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{c}\right )} + 2 \, a^{2}{\left (\frac{\log \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{c} - \frac{\log \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{c} - \frac{\cos \left (f x + e\right ) + 1}{c \sin \left (f x + e\right )}\right )} - \frac{a^{2}{\left (\cos \left (f x + e\right ) + 1\right )}}{c \sin \left (f x + e\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.476103, size = 275, normalized size = 3.72 \begin{align*} -\frac{3 \, a^{2} \cos \left (f x + e\right ) \log \left (\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 3 \, a^{2} \cos \left (f x + e\right ) \log \left (-\sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 10 \, a^{2} \cos \left (f x + e\right )^{2} - 8 \, a^{2} \cos \left (f x + e\right ) + 2 \, a^{2}}{2 \, c f \cos \left (f x + e\right ) \sin \left (f x + e\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} - \frac{a^{2} \left (\int \frac{\sec{\left (e + f x \right )}}{\sec{\left (e + f x \right )} - 1}\, dx + \int \frac{2 \sec ^{2}{\left (e + f x \right )}}{\sec{\left (e + f x \right )} - 1}\, dx + \int \frac{\sec ^{3}{\left (e + f x \right )}}{\sec{\left (e + f x \right )} - 1}\, dx\right )}{c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.3107, size = 142, normalized size = 1.92 \begin{align*} -\frac{\frac{3 \, a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{c} - \frac{3 \, a^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{c} - \frac{2 \,{\left (3 \, a^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 2 \, a^{2}\right )}}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )\right )} c}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]